﻿using System;
using System.Reflection;
using System.Collections.ObjectModel;

namespace Ooaavee.Events
{
    /// <summary>
    /// Provides data for any event.
    /// </summary>
    public interface IEvent
    {
        /// <summary>
        /// Gets the name of the event.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets the arguments of the event.
        /// </summary>
        ReadOnlyCollection<object> Args { get; }

        /// <summary>
        /// Gets the underlying event.
        /// </summary>
        EventInfo UnderlyingEvent { get; }

        /// <summary>
        /// Tries to get the standard event parameters from this received event.
        /// </summary>
        /// <typeparam name="TEventArgs">The type of event-specific data.</typeparam>
        /// <returns>the standard event parameters, or null not available</returns>
        StandardEventParameters<TEventArgs> GetStandardEventParameters<TEventArgs>() where TEventArgs : EventArgs;
    }
}